home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 February: Tool Chest / Dev.CD Feb 00 TC.toast / pc / tool chest / macapp / install macapp r13u4 / Apple Frameworks / MacApp / Examples / Skeleton / Skeleton.r / Skeleton.r
Encoding:
Text File  |  1998-10-13  |  15.7 KB  |  571 lines  |  [TEXT/MPS ]

  1. //--------------------------------------------------------------------------------------------------
  2. // Skeleton.r
  3. // Copyright © 1991-98 by Apple Computer, Inc. All rights reserved. 
  4. //
  5. //    Resource File for the Skeleton Sample Program. 
  6. //--------------------------------------------------------------------------------------------------
  7.  
  8. /*
  9.     Change History:
  10.         07/16/98    [TY] Added missing ';'.
  11. */
  12.  
  13. //--------------------------------------------------------------------------------------------------
  14. // INCLUDE FILES 
  15. //--------------------------------------------------------------------------------------------------
  16.  
  17. // Standard Includes 
  18.  
  19. // MacAppTypes.r must be first
  20. #ifndef __MacAppTypes__
  21. #include "MacAppTypes.r"
  22. #endif
  23.  
  24. #ifndef __SYSTYPES_R__
  25. #include "SysTypes.r"
  26. #endif
  27.  
  28. #ifndef __BalloonTypes__
  29. #include "BalloonTypes.r"
  30. #endif
  31.  
  32. #ifndef __MACAPPVERSION__
  33. #include "MacAppVersion.h"
  34. #endif
  35.  
  36. #ifndef __ViewTypes__
  37. #include "ViewTypes.r"
  38. #endif
  39.  
  40. #ifndef THINK_Rez
  41. #if qDebug | qPerform
  42. include "Debug.rsrc" not 'ckid';
  43. #endif
  44.  
  45. include "Dialog.rsrc" not 'ckid';
  46. include "MacApp.rsrc" not 'ckid';
  47.  
  48. // Includes for Building Blocks
  49.  
  50. include "Printing.rsrc" not 'ckid';
  51.  
  52. // Include Code Resources
  53.  
  54. #ifndef MW_Rez
  55. #if !qNoCode
  56. include $$Shell("ObjApp")$$Shell("XAppName") 'CODE';
  57. #if qModelCFM
  58. include $$Shell("ObjApp")$$Shell("XAppName") 'cfrg';
  59. include $$Shell("ObjApp")$$Shell("XAppName") 'rseg';
  60. #endif
  61. #endif
  62. #endif // MW_Rez 
  63. #endif //!THINK_Rez
  64.  
  65. //--------------------------------------------------------------------------------------------------
  66. // CONSTANTS 
  67. //--------------------------------------------------------------------------------------------------
  68.  
  69. // Finder Information
  70. // ------------------
  71.  
  72. #if !defined(THINK_Rez) && !defined(MW_Rez)
  73. #define kApplicationName    $$Shell("XAppName")
  74. #else
  75. #define kApplicationName    TARGET_APPLICATION_NAME
  76. #endif // !THINK_Rez
  77.  
  78. #define kSignature            'SS02'            // Application signature 
  79. #define kFileType            'SF02'            // Data file type 
  80. #define kStationery            'sF02'            // Stationery file type 
  81.  
  82. // Bundle Constants
  83. // ------------------
  84.  
  85. #define kBundleID                        128
  86. #define kApplicationID                    128
  87. #define kDocumentID                        129
  88. #define kStationeryID                    130
  89.  
  90. // Constants for Menu IDs
  91. // ----------------------
  92.  
  93. #define mSkeletonMenu    4
  94.  
  95. // Command Numbers For Menu Items
  96. // ------------------------------
  97.  
  98. #define cCommandHandledByApplication    400
  99. #define cCommandHandledByDocument        401
  100. #define cCommandHandledByView            402
  101. #define cTrackerCommand                    403
  102.  
  103. // STR# resources
  104. // --------------
  105.  
  106. #define kSkeletonMenuHelp                1000
  107. #define kSkeletonWindowTitles            1001
  108.  
  109. // Text styles
  110. // --------------
  111.  
  112. #define kSystemTextStyle                1000
  113.  
  114. // 'View' resources
  115. // --------------
  116.  
  117. #define kSkeletonWindowID                kDefaultWindowID
  118.  
  119. // Memory Management Resources
  120. // ---------------------------
  121.  
  122. #define kSkeletonSeg    1000
  123. #define kSkeletonMem    1000
  124. #define kSkeletonRes    1000
  125.  
  126. //--------------------------------------------------------------------------------------------------
  127. // RESOURCES FOR MENUS 
  128. //--------------------------------------------------------------------------------------------------
  129.  
  130. //--------------------------------------------------------------------------------------------------
  131. // Menu Bars 
  132. //--------------------------------------------------------------------------------------------------
  133.  
  134. resource 'MBAR' (kMBarDisplayed,
  135. #if qNames
  136. "Skeleton MBAR",
  137. #endif
  138.     purgeable) {
  139.     { mApple; mFile; mEdit; mSkeletonMenu }
  140. };
  141.  
  142. //--------------------------------------------------------------------------------------------------
  143. // Menus 
  144. //--------------------------------------------------------------------------------------------------
  145.  
  146. include "Defaults.rsrc" 'CMNU' (mApple);    // Grab the default Apple menus
  147. include "Defaults.rsrc" 'CMNU' (mFile);        // Grab the default File menus
  148. include "Defaults.rsrc" 'CMNU' (mEdit);        // Grab the default Edit menu
  149.  
  150. resource 'CMNU' (mSkeletonMenu,
  151. #if qNames
  152. "Skeleton Menu",
  153. #endif
  154. nonpurgeable) {
  155.     mSkeletonMenu,
  156.     textMenuProc,
  157.     EnablingManagedByMacApp,
  158.     enabled,
  159.     "SkeletonMenu",
  160.      {    /* array: 3 elements */
  161. /* [1] */    "Command Handled By Application",noIcon, "1", noMark, plain, cCommandHandledByApplication;
  162. /* [2] */    "Command Handled By Document", noIcon, "2", noMark, plain, cCommandHandledByDocument;
  163. /* [3] */    "Command Handled By View",    noIcon, "3", noMark, plain, cCommandHandledByView;
  164.       }
  165.     };
  166.  
  167. resource 'CMNU' (mBuzzwords,
  168. #if qNames
  169. "Buzzwords",
  170. #endif
  171. purgeable
  172. ) {
  173.     mBuzzwords,
  174.     textMenuProc,
  175.     EnablingManagedByMacApp,
  176.     enabled,
  177.     "Buzzwords",
  178.      {    /* array: 13 elements */
  179.         "Page Setup Change",    noIcon,    noKey,    noMark, plain, cChangePrinterStyle;
  180.         "Typing",                noIcon,    noKey,    noMark,    plain, cTyping;
  181.         "Tracker Command",        noIcon,    noKey,    noMark, plain, cTrackerCommand;
  182.     }
  183. };
  184.  
  185. //--------------------------------------------------------------------------------------------------
  186. // Balloon Help Resources for Menus 
  187. //--------------------------------------------------------------------------------------------------
  188.  
  189. // Includes resource 'STR#' (kStandardHelpStrings, "Balloon Help String 1")
  190. // with our application name substituted in strings
  191. #include "HelpStrings.r"
  192.  
  193. include "Defaults.rsrc"  'hmnu' (mFile);    
  194. include "Defaults.rsrc"  'hmnu' (mEdit);    
  195.  
  196. resource 'STR#' (kSkeletonMenuHelp, purgeable) { 
  197.     {
  198.         "No help yet for this  item",
  199.         "Help For Menu Title",
  200.         "Help For First Menu Item",
  201.         "Help For Second Menu Item",
  202.         "Help For Third Menu Item",
  203.     }
  204. };
  205.  
  206. resource 'hmnu' (mSkeletonMenu) 
  207. {
  208.     HelpMgrVersion,
  209.     hmDefaultOptions,
  210.     0, // balloon definition function 
  211.     0, // variation code 
  212.     
  213.     // Missing items 
  214.     HMStringResItem 
  215.     {
  216.         kSkeletonMenuHelp,1,
  217.         kSkeletonMenuHelp,1,
  218.         kSkeletonMenuHelp,1,
  219.         kSkeletonMenuHelp,1,
  220.     },
  221.     
  222.     // Title and items 
  223.     {    
  224.         // Title 
  225.         HMStringResItem 
  226.         {
  227.             kSkeletonMenuHelp,2,
  228.             kSkeletonMenuHelp,2,
  229.             kSkeletonMenuHelp,2,
  230.             kSkeletonMenuHelp,2,
  231.         },
  232.         // First Item 
  233.         HMStringResItem 
  234.         {
  235.             kSkeletonMenuHelp,3,
  236.             kSkeletonMenuHelp,3,
  237.             kSkeletonMenuHelp,3,
  238.             kSkeletonMenuHelp,3,
  239.         },
  240.         // Second Item
  241.         HMStringResItem 
  242.         {
  243.             kSkeletonMenuHelp,4,
  244.             kSkeletonMenuHelp,4,
  245.             kSkeletonMenuHelp,4,
  246.             kSkeletonMenuHelp,4,
  247.         },
  248.         // Third Item
  249.         HMStringResItem 
  250.         {
  251.             kSkeletonMenuHelp,5,
  252.             kSkeletonMenuHelp,5,
  253.             kSkeletonMenuHelp,5,
  254.             kSkeletonMenuHelp,5,
  255.         },
  256.     }
  257. };
  258.  
  259. //--------------------------------------------------------------------------------------------------
  260. // RESOURCES FOR VIEWS, DIALOGS, ALERTS etc. 
  261. //--------------------------------------------------------------------------------------------------
  262.  
  263. //--------------------------------------------------------------------------------------------------
  264. // About Box
  265. //--------------------------------------------------------------------------------------------------
  266.  
  267. resource 'DITL' (phAboutApp,
  268. #if qNames
  269. "phAboutApp",
  270. #endif
  271.     purgeable) {
  272.      {    /* array DITLarray: 3 elements */
  273.         /* [1] */
  274.         {167, 288, 187, 348},
  275.         Button {
  276.             enabled,
  277.             "OK"
  278.         };
  279.         /* [2] */
  280.         {10, 75, 154, 348},
  281.         StaticText {
  282.             disabled,
  283.             "This sample program demonstrates large views and mouse tracking."
  284.             "\n"
  285.             WRITTEN_WITH_MACAPP
  286.         };
  287.         /* [3] */
  288.         {10, 20, 42, 52},
  289.         Icon {
  290.             disabled,
  291.             noteIcon
  292.         }
  293.     }
  294. };
  295.  
  296. include "Defaults.rsrc"  'ALRT' (phAboutApp);        // Grab the default about box
  297. include "Defaults.rsrc"    'aete' (0);                    // Grab the default AppleEvent terminology
  298. include "Defaults.rsrc"  'STR#' (kDefaultCredits);    // Grab the default credits
  299.  
  300.  
  301. //--------------------------------------------------------------------------------------------------
  302. // MultiFinder™ information
  303. //--------------------------------------------------------------------------------------------------
  304.  
  305. /* Additional size deltas to be added to partition size */
  306.  
  307. #if qNames
  308. #define kNamesSizeDelta 75
  309. #else
  310. #define kNamesSizeDelta 0
  311. #endif
  312.  
  313. #if qDebug
  314. #define kDebugSizeDelta 0
  315. #else
  316. #define kDebugSizeDelta 0
  317. #endif
  318.  
  319. #define kModelFarSizeDelta 0
  320.  
  321. #ifndef MW_Rez                    // MW projects supply size resource for us
  322. resource 'SIZE' (-1) {
  323.     saveScreen,
  324.     acceptSuspendResumeEvents,
  325.     enableOptionSwitch,
  326.     canBackground,
  327.     doesActivateOnFGSwitch,
  328.     backgroundAndForeground,
  329.     dontGetFrontClicks,
  330.     ignoreAppDiedEvents,
  331.     is32BitCompatible,
  332.     isHighLevelEventAware,
  333.     localAndRemoteHLEvents,
  334.     notStationeryAware,                
  335.     reserved,
  336.     reserved,
  337.     reserved,
  338.     reserved,
  339.     
  340.     /* Suggested partition size */
  341.     (1000 + kNamesSizeDelta + kDebugSizeDelta + kModelFarSizeDelta) * 1024,
  342.     
  343.     /* Minimum partition size */
  344.     (800 + kNamesSizeDelta + kDebugSizeDelta + kModelFarSizeDelta) * 1024
  345. };
  346. #endif // !MW_Rez
  347.  
  348. //--------------------------------------------------------------------------------------------------
  349. // Icons
  350. //--------------------------------------------------------------------------------------------------
  351.  
  352. include "Defaults.rsrc"  'ICN#' (kApplicationID);    // MacApp Family large black & white    
  353. include "Defaults.rsrc"  'ICN#' (kDocumentID);        // MacApp Document large black & white
  354. include "Defaults.rsrc"  'ICN#' (kStationeryID);    // MacApp Stationery large black & white    
  355. include "Defaults.rsrc"  'ics#' (kApplicationID);    // MacApp Family small black & white    
  356. include "Defaults.rsrc"  'ics#' (kDocumentID);        // MacApp Document small black & white
  357. include "Defaults.rsrc"  'ics#' (kStationeryID);    // MacApp Stationery small black & white
  358. include "Defaults.rsrc"  'ics4' (kApplicationID);    // MacApp Family small 4 bit
  359. include "Defaults.rsrc"  'ics4' (kDocumentID);        // MacApp Document small 4 bit
  360. include "Defaults.rsrc"  'ics4' (kStationeryID);    // MacApp Stationery small 4 bit
  361. include "Defaults.rsrc"  'ics8' (kApplicationID);    // MacApp Family small 4 bit
  362. include "Defaults.rsrc"  'ics8' (kDocumentID);        // MacApp Document small 4 bit
  363. include "Defaults.rsrc"  'ics8' (kStationeryID);    // MacApp Stationery small 4 bit
  364. include "Defaults.rsrc"  'icl4' (kApplicationID);    // MacApp Family large 4 bit
  365. include "Defaults.rsrc"  'icl4' (kDocumentID);        // MacApp Document large 4 bit
  366. include "Defaults.rsrc"  'icl4' (kStationeryID);    // MacApp Stationery large 4 bit
  367. include "Defaults.rsrc"  'icl8' (kApplicationID);    // MacApp Family large 8 bit
  368. include "Defaults.rsrc"  'icl8' (kDocumentID);        // MacApp Document large 8 bit
  369. include "Defaults.rsrc"  'icl8' (kStationeryID);    // MacApp Stationery large 8 bit
  370.  
  371. //--------------------------------------------------------------------------------------------------
  372. // Memory usage information for Skeleton
  373. //--------------------------------------------------------------------------------------------------
  374.  
  375. // See UMemory.h
  376. // -------------
  377.  
  378. // Code fragment resource for PowerPC native apps
  379. // ----------------------------------------------
  380. #ifndef MW_Rez     // Metrowerks will supply it's own cfrg
  381. #if qPowerPC
  382. #include "CodeFragmentTypes.r"
  383.  
  384. resource 'cfrg' (0, "Configuration Info") {
  385.     {
  386.         kPowerPC,
  387.         kFullLib,
  388.         kNoVersionNum,
  389.         kNoVersionNum,
  390.         0,
  391.         0,
  392.         kIsApp,
  393.         kOnDiskFlat,
  394.         kZeroOffset,
  395.         kWholeFork,
  396.         "Skeleton"
  397.     }
  398. };
  399. #endif
  400. #endif // MW_Rez
  401.  
  402. //--------------------------------------------------------------------------------------------------
  403. // Icons, Bundles and FRefs… Oh my! (don't forget the Signature)
  404. //--------------------------------------------------------------------------------------------------
  405.  
  406. type kSignature as 'STR ';
  407. resource kSignature (0,
  408. #if qNames
  409. "Signature",
  410. #endif
  411.     purgeable) {
  412.     "Skeleton ©Apple Computer, Inc. 1988-95"
  413. };
  414.  
  415. resource 'FREF' (kApplicationID,
  416. #if qNames
  417. "Skeleton Application",
  418. #endif
  419.     purgeable) {
  420.     'APPL',
  421.     0,
  422.     ""
  423. };
  424.  
  425. resource 'FREF' (kDocumentID,
  426. #if qNames
  427. "Skeleton Document",
  428. #endif
  429.     purgeable) {
  430.     kFileType,
  431.     1,
  432.     ""
  433. };
  434.  
  435. resource 'FREF' (kStationeryID,
  436. #if qNames
  437. "Skeleton Stationery",
  438. #endif
  439.     purgeable) {
  440.     kStationery,
  441.     2,
  442.     ""
  443. };
  444.  
  445. resource 'BNDL' (kBundleID,
  446. #if qNames
  447. "Skeleton",
  448. #endif
  449.     purgeable) {
  450.     kSignature,
  451.     0,
  452.     { /* array TypeArray: 2 elements */
  453.         /* [1] */
  454.         'ICN#',
  455.         { /* array IDArray: 3 elements */
  456.             0, kApplicationID,
  457.             1, kDocumentID,
  458.             2, kStationeryID
  459.         },
  460.         /* [2] */
  461.         'FREF',
  462.         { /* array IDArray: 3 elements */
  463.             0, kApplicationID,
  464.             1, kDocumentID,
  465.             2, kStationeryID
  466.         }
  467.     }
  468. };
  469.  
  470. //--------------------------------------------------------------------------------------------------
  471. //  Version resources
  472. //--------------------------------------------------------------------------------------------------
  473.  
  474. // The revision of this particular file
  475.  
  476. RESOURCE 'vers' (1,
  477. #if qNames
  478. "File Version",
  479. #endif
  480.     purgeable) {
  481.     0x01,
  482.     0x01,
  483.     development,
  484.     0x01,
  485.     verUs,
  486.     "1.1d1",
  487.     "Skeleton 1.1d1, ©Apple Computer, Inc. 1988-97"
  488. };
  489. include "Defaults.rsrc"  'vers' (2);        // Overall package
  490.  
  491. //--------------------------------------------------------------------------------------------------
  492. // Views 
  493. //--------------------------------------------------------------------------------------------------
  494. #ifndef MW_Rez    
  495.     // This Adlib file is included in IconEdit.prj for MW Builds
  496.     include "IconEdit.view";    
  497. #endif
  498.  
  499. #if 0 // The following has been moved into IconEdit.view AdLib file
  500.  
  501. resource 'STR#' (kSkeletonWindowTitles,
  502. #if qNames
  503. "Window titles",
  504. #endif
  505. purgeable) {
  506.     {
  507.     ""
  508.     }
  509. };
  510.  
  511. resource 'TxSt' (kSystemTextStyle, purgeable) {tsPlain, 0, black, ""};
  512.  
  513. resource 'View' (kSkeletonWindowID,
  514. #if qNames
  515. "kSkeletonWindowID",
  516. #endif
  517. purgeable) { MAThreeOh, 
  518.     {
  519.     ViewSignatureAndClassname
  520.         {'wind', 534, "", 'WIND', enabled, noIdle, {}, MAThreeOh, 
  521.         {50, 20}, {260, 430}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  522.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  523.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  524.         NoDrawingEnvironment {}, 
  525.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  526.             AdornFirst, AdornerLocalObject {EraseAdorner}, 
  527.             DrawView, AdornerLocalObject {DrawAdorner}, 
  528.             AdornLast, AdornerLocalObject {ResizeIconAdorner}}}, emptyUserArea, 
  529.         Window {zoomDocProc, 'SKEL', goAwayBox, resizable, ignoreFirstClick, 
  530.             freeOnClosing, disposeOnFree, closesDocument, openWithDocument, dontAdaptToScreen, stagger, forceOnScreen, 
  531.             dontCenter, doesntFloat, doesntHideOnSuspend, generateActivates, filler, kSkeletonWindowTitles, 1}, 3}, 
  532.     ViewSignatureAndClassname
  533.         {'scrl', 186, "", 'SCLR', enabled, noIdle, {}, MAThreeOh, 
  534.         {0, 0}, {245, 415}, sizeRelSuperView, sizeRelSuperView, shown, doesntWantToBeTarget, 
  535.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  536.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  537.         NoDrawingEnvironment {}, 
  538.         NoAdorners {}, emptyUserArea, 
  539.         Scroller {'vCLR', 'hCLR', {0, 0}, {16, 16}, VertConstrain, HorzConstrain, noInset, respondsToFKeys}, 1}, 
  540.     ViewSignatureAndClassname
  541.         {'view', 75, "TViewSkeleton", 'SKEL', enabled, noIdle, {}, MAThreeOh, 
  542.         {0, 0}, {72 * 15, 72 * 12}, sizeFixed, sizeFixed, shown, doesntWantToBeTarget, 
  543.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  544.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  545.         NoDrawingEnvironment {}, 
  546.         NoAdorners {}, emptyUserArea, 
  547.         View {}, 
  548.         NoSubviews},
  549.     ViewSignatureAndClassname
  550.         {'ssbr', 101, "", 'hCLR', enabled, noIdle, {}, MAThreeOh, 
  551.         {245, -1}, {16, 417}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  552.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  553.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  554.         NoDrawingEnvironment {}, 
  555.         NoAdorners {}, emptyUserArea, 
  556.         ScrollerScrollBar {mHScrollBarHit, notHilited, notDimmed, sizeable, noInset, kSystemTextStyle, dontPreferOutline, h, 0, 0, 39585}, 
  557.         NoSubviews}, 
  558.     ViewSignatureAndClassname
  559.         {'ssbr', 101, "", 'vCLR', enabled, noIdle, {}, MAThreeOh, 
  560.         {-1, 415}, {247, 16}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  561.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  562.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  563.         NoDrawingEnvironment {}, 
  564.         NoAdorners {}, emptyUserArea, 
  565.         ScrollerScrollBar {mVScrollBarHit, notHilited, notDimmed, sizeable, noInset, kSystemTextStyle, dontPreferOutline, v, 0, 0, 49755}, 
  566.         NoSubviews}
  567.     }
  568. };
  569.  
  570. #endif // Views moved into Skeleton.view AdLib file
  571.